package org.qiuqiu.service.impl;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.qiuqiu.dao.PostMapper;
import org.qiuqiu.service.PostService;
import org.qiuqiu.vo.PaginationVO;
import org.qiuqiu.vo.Post;
import org.qiuqiu.vo.PostExample;
import org.qiuqiu.vo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class PostServiceImpl  implements PostService {
@Autowired
  private PostMapper postmapper;
	public int countByExample(PostExample example) {
		// TODO Auto-generated method stub
		return postmapper.countByExample(example);
	}

	public int deleteByExample(PostExample example) {
		// TODO Auto-generated method stub
		return postmapper.deleteByExample(example);
	}

	public int deleteByPrimaryKey(Integer postid) {
		// TODO Auto-generated method stub
		return postmapper.deleteByPrimaryKey(postid);
	}

	public int insert(Post record) {
		// TODO Auto-generated method stub
		return postmapper.insert(record);
	}

	public int insertSelective(Post record) {
		// TODO Auto-generated method stub
		return 0;
	}

	public List<Post> selectByExample(PostExample example) {
		// TODO Auto-generated method stub
		return postmapper.selectByExample(example);
	}
	public Post selectByPrimaryKey(Integer postid) {	
		return postmapper.selectByPrimaryKey(postid);
	}

	public int updateByExampleSelective(Post record, PostExample example) {
		// TODO Auto-generated method stub
		return postmapper.updateByExampleSelective(record, example);
	}

	public int updateByExample(Post record, PostExample example) {
		// TODO Auto-generated method stub
		return 0;
	}

	public int updateByPrimaryKeySelective(Post record) {
		// TODO Auto-generated method stub
		return postmapper.updateByPrimaryKey(record);
	}

	public int updateByPrimaryKey(Post record) {
	
		return postmapper.updateByPrimaryKey(record);
	}
	public List<Post> selectPageByAll(PaginationVO page, Post post) {
		return postmapper.selectPageByAll(page, post);
	}

	/* (non-Javadoc)
	 * @see org.qiuqiu.service.PostService#findallClickandInfo(org.qiuqiu.vo.PaginationVO)
	 */
	public List<Post> findallClickandInfo(PaginationVO page) {
		
		return postmapper.findallClickandInfo(page);
	}

	/* (non-Javadoc)
	 * @see org.qiuqiu.service.PostService#totalInfo()
	 */
	public int totalInfo() {
		
		return postmapper.totalInfo();
	}

	/* (non-Javadoc)
	 * @see org.qiuqiu.service.PostService#updateRe(java.lang.Integer)
	 */
	public int updateRe(Integer postid) {
	
		return postmapper.updateRe(postid);
	}

	/* (non-Javadoc)
	 * @see org.qiuqiu.service.PostService#findAllPostByUser(org.qiuqiu.vo.User, org.qiuqiu.vo.PaginationVO)
	 */
	public List<Post> findAllPostByUser(User user, PaginationVO page) {
		
		return postmapper.findAllPostByUser(user, page);
	}

	/* (non-Javadoc)
	 * @see org.qiuqiu.service.PostService#countPostByUser(org.qiuqiu.vo.User)
	 */
	public int countPostByUser(User user) {
	
		return postmapper.countPostByUser(user);
	}
}
